import React, {Component} from 'react'
import classNames from 'classnames'

interface RowProps {
  className?: string
  form?: boolean
  noGutters?: boolean
  attributes?: any[]
  attribute?: any
}

class Row extends Component<RowProps> {
  render() {
    const {className, form, noGutters, attribute, children} = this.props
    const resultClassName: string = classNames(
      className,
      noGutters ? 'no-gutters' : null,
      form ? 'form-row' : 'row',
    )
    return (
      <div {...attribute} className={resultClassName}>
        {children}
      </div>
    )
  }
}

export default Row
